/*
 * font.c - Font for Akizuki 32x16 LED Matrix
 *
 * Copyright (C) 2009  Free Software Initiative of Japan
 *
 * Written by Niibe Yutaka
 *
 * Enanced by Wiktor Langowski <jolkaczad@gmail.com
 *  - proportional font support
 *
 * Distributed under GNU General Public Licence version 3 (or later)
 */

#include <stddef.h>
#include <avr/pgmspace.h>

#include "etl-font-r-dev.c.inc"

/* Returns width (number of columns) for a character C */
unsigned char char_width (unsigned char c)
{
  if (c < MIN_CHAR || c > MAX_CHAR)
    return -1;
  else
    return pgm_read_byte(&etl_font_data[(c - MIN_CHAR)*SEGM_SIZE]);
}

/* Returns pointer to bits for a character C */
const unsigned char *char_bits (unsigned char c)
{
  if (c < MIN_CHAR || c > MAX_CHAR)
    return NULL;
  else
    return &etl_font_data[((c - MIN_CHAR)*SEGM_SIZE)+1];
}
